package com.zbkj.front.model.vo;

import com.zbkj.dal.entity.order.OrderAddress;
import com.zbkj.dal.pojo.response.OrderInvoiceResponse;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalDateTime;

@Data
public class SharePickupInfoVO {

    @ApiModelProperty("寄件码")
    private String pickupCode;

    @ApiModelProperty("预约时间")
    private LocalDateTime pickupTime;

    @ApiModelProperty("省code")
    private Integer provinceCode;

    @ApiModelProperty("省名称")
    private String provinceName;

    @ApiModelProperty("市code")
    private Integer cityCode;

    @ApiModelProperty("市名称")
    private String cityName;

    @ApiModelProperty("区code")
    private Integer regionCode;

    @ApiModelProperty("区名称")
    private String regionName;

    @ApiModelProperty("镇code")
    private Integer townCode;

    @ApiModelProperty("镇名称")
    private String townName;

    @ApiModelProperty("详细地址")
    private String address;


    public static SharePickupInfoVO build(OrderInvoiceResponse orderInvoice, OrderAddress orderAddress) {
        SharePickupInfoVO sharePickupInfoVO = new SharePickupInfoVO();
        sharePickupInfoVO.setPickupCode(orderInvoice.getPickupCode());
        sharePickupInfoVO.setPickupTime(orderInvoice.getPickupTime());
        sharePickupInfoVO.setProvinceCode(orderAddress.getProvinceCode());
        sharePickupInfoVO.setProvinceName(orderAddress.getProvinceName());
        sharePickupInfoVO.setCityCode(orderAddress.getCityCode());
        sharePickupInfoVO.setCityName(orderAddress.getCityName());
        sharePickupInfoVO.setRegionCode(orderAddress.getRegionCode());
        sharePickupInfoVO.setRegionName(orderAddress.getRegionName());
        sharePickupInfoVO.setTownCode(orderAddress.getTownCode());
        sharePickupInfoVO.setTownName(orderAddress.getTownName());
        sharePickupInfoVO.setAddress(orderAddress.getAddress());
        return sharePickupInfoVO;
    }



}
